﻿using QLInternet.Components;
using QLInternet.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace QLInternet.ViewModel
{
    class ModemViewModel: ObservableObject
    {
        private Modem modem;

        private ObservableCollection<Modem> listModem;
        

        private int sTT;

        public int STT
        {
            get { return sTT; }
            set { sTT = value; }
        }

        public int MaModem
        {
            get { return modem.MaModem; }
            set 
            { 
                if(modem.MaModem!= value)
                {
                    modem.MaModem = value;
                    NotifyPropertyChanged("MaModem");
                }
            }
        }
        public string TenModem
        {
            get { return modem.TenModem; }
            set 
            {
                if (modem.TenModem!= value)
                {
                    modem.TenModem = value;
                    NotifyPropertyChanged("TenModem");
                }
            }
        }
        public int LoaiCaiDat
        {
            get { return modem.LoaiCaiDat; }
            set
            {
                if (modem.LoaiCaiDat != value)
                {
                    modem.LoaiCaiDat = value;
                    NotifyPropertyChanged("LoaiCaiDat");
                }
            }
        }
        public int DonGia
        {
            get { return modem.DonGia; }
            set
            {
                if (modem.DonGia != value)
                {
                    modem.DonGia= value;
                    NotifyPropertyChanged("DonGia");
                }
            }
        }

        public ObservableCollection<Modem> ListModem
        {
            get { return listModem; }

        }

        public ModemViewModel()
        {
            modem = new Modem();
            listModem = modem.getDSModem();
        }

    }
}
